#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
int main()
{
	int arr[100];
	int num = 0;
	int count = 0;
	while (scanf("%d", &num) != EOF)
	{
		for (int i = 2; i <= num; i++)
		{
			arr[i - 2] = i;
		}
		for (int i = 1; i < num - 1; i++)
		{
			int flag = 1;
			for (int j = 2; j < arr[i]; j++)
			{
				if (arr[i] % j == 0)
				{
					flag = 0;
					break;
				}
			}
			if (flag == 0)
			{
				arr[i] = 0;
				count++;
			}
		}
		for (int i = 0; i < num - 2; i++)
		{
			if (arr[i] != 0)
				printf("%d ", arr[i]);
		}
		printf("\n%d\n", count);
	}
	return 0;
}